# $Id: PKGBUILD 67903 2012-03-15 23:14:54Z ebelanger $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Bartek Iwaniec <hash87 [at] gmail [dot] com>

pkgname=synce-sync-engine
pkgver=0.15
pkgrel=4
pkgdesc="SynCE sync-engine"
arch=(any)
license=('GPL')
url="http://www.synce.org/"
depends=(synce-libsynce synce-rra synce-librapi librtfcomp dbus-python setuptools pygobject libopensync python2-lxml)
install=${pkgname}.install
source=(http://downloads.sourceforge.net/synce/${pkgname}-${pkgver}.tar.gz)
md5sums=('3ed81acc39e21effe765fb5f3b248d73')

build() {
  cd $srcdir/${pkgname}-${pkgver}
  python2 setup.py build
  python2 setup.py install --root=$pkgdir
  sed -i 's|opensync-1.0|libopensync|' synce-install-plugins.py
  sed -i "s_os.system('mkdir -p %s' % plugindir)_os.system('mkdir -p %s%s' % ('$pkgdir', plugindir))_" synce-install-plugins.py
  sed -i "s_os.system('cp %s/%s %s' % (pluginsource,driver, plugindir))_os.system('cp %s/%s %s%s' % (pluginsource,driver,'$pkgdir',plugindir))_" synce-install-plugins.py
  python2 synce-install-plugins.py
}
